//
//  TGHttpRequest.h
//  GroupBuy
//
//  Created by wwj on 15/11/10.
//  Copyright © 2015年 wwj. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CLLocation.h>

typedef void (^SuccessBlock)(id data, id totalCount);
typedef void (^ErrorBlock)(NSError *error);

@interface TGHttpRequest : NSObject


/**
 *  获取分类元数据
 *
 *  @param success
 *  @param error
 */
+(void)getCategoriesWithSuccess:(SuccessBlock)success error:(ErrorBlock)error;


/**
 *  获取团购列表数据
 *
 *  @param index   页数
 *  @param success
 *  @param error   
 */
+(void)getGroupListWithPage:(int)page success:(SuccessBlock)success error:(ErrorBlock)error;

/**
 *  获取团购详情
 *
 *  @param dealID
 *  @param success
 *  @param error   
 */
+(void)getGroupDetailWithDealId:(NSString *)dealID success:(SuccessBlock)success error:(ErrorBlock)error;

/**
 *  根据坐标获取周边团购
 *
 *  @param position
 *  @param success
 *  @param error    
 */
+(void)getgroupListWithPosition:(CLLocationCoordinate2D)position success:(SuccessBlock)success error:(ErrorBlock)error;


@end
